import Vue from 'vue';
import Router from 'vue-router';

Vue.use(Router);

export default new Router({
    routes: [{
        path: '/',
        redirect: '/map'
    },
    {
        path: '/',
        component: resolve => require(['../components/common/Home.vue'], resolve),
        meta: {
            title: ''
        },
        children: [
            {
                path: '/iview',
                component: resolve => require(['../components/page/DataView.vue'], resolve),
                meta: {
                    title: '数据编辑'
                }
            },
            {
                path: '/table',
                component: resolve => require(['../components/page/DataEditor.vue'], resolve),
                meta: {
                    title: '数据查看'
                }
            },
            {
                path: '/form',
                component: resolve => require(['../components/page/BaseForm.vue'], resolve),
                meta: {
                    title: '基本表单'
                }
            },
            {
                // 上传组件
                path: '/upload',
                component: resolve => require(['../components/page/UploadExcel.vue'], resolve),
                meta: {
                    title: '文件上传'
                }
            },
            {
                // 图表
                path: '/charts',
                component: resolve => require(['../components/page/ECharts.vue'], resolve),
                meta: {
                    title: '图表'
                }
            },
            {
                // 二维地图
                path: '/map',
                component: resolve => require(['../components/page/Map.vue'], resolve),
                meta: {
                    title: '二维地图'
                }
            },
            {
                // 三维地图
                path: '/_3dmap',
                component: resolve => require(['../components/page/3DMap.vue'], resolve),
                meta: {
                    title: '三维地图'
                }
            },
            {
                // 历史地图
                path: '/timelinemap',
                component: resolve => require(['../components/page/historyMap.vue'], resolve),
                meta: {
                    title: '历史地图'
                }
            },
            {
                // LayerSpy
                path: '/LayerSpy',
                component: resolve => require(['../components/page/LayerSpy.vue'], resolve),
                meta: {
                    title: '透视效果'
                }
            },
            {
                // LayerSpy
                path: '/LayerSwipe',
                component: resolve => require(['../components/page/LayerSwipe.vue'], resolve),
                meta: {
                    title: '卷帘效果'
                }
            },
            {
                path: '/404',
                component: resolve => require(['../components/page/Page404.vue'], resolve),
                meta: { title: '404' }
            },
            {
                path: '/tabs',
                component: resolve => require(['../components/page/Tabs.vue'], resolve),
                meta: {
                    title: '操作消息'
                }
            }
            // ,{
            //     // LayerSpy
            //     path: '/geojson',
            //     component: resolve => require(['../components/page/GeoJson.vue'], resolve),
            //     meta: {
            //         title: 'GeoJson'
            //     }
            // }
        ]
    },
    {
        path: '/login',
        component: resolve => require(['../components/page/Login.vue'], resolve)
    },
    {
        path: '*',
        redirect: '/404'
    }
    ]
})
